<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" import="com.unitedats.common.util.*"%>
<html>
<%
  String dest = (String)request.getAttribute("dest");
  Boolean excludeHead = (Boolean) request.getAttribute("excludeHead");
  Boolean excludeInterface = (Boolean) request.getAttribute("excludeInterface");
  Boolean excludeMenu = (Boolean) request.getAttribute("excludeMenu");
  String msg = WebUtil.getSessionMessage(request);
  String path = request.getContextPath();
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<%if(excludeHead == null || !excludeHead){%>
<!--<link type="text/css" rel="stylesheet" href="js/jquery-ui-1.10.4/css/ui-lightness/jquery-ui-1.10.4.css">-->
<link type="text/css" rel="stylesheet" href="css/jquery-ui-themes-1.10.4/themes/flick/jquery-ui.min.css"/>
<link type="text/css" rel="stylesheet" href="css/jquery-ui-themes-1.10.4/themes/flick/jquery.ui.theme.css"/>
<link type="text/css" rel="stylesheet" href="js/jquery.tablesorter/themes/blue/style.css">
<link rel="stylesheet" href="js/appendGrid/jquery.appendGrid-1.3.5.min.css" />
<link rel="stylesheet" href="css/pure-min.css"/>
<link rel="stylesheet" href="css/pure-skin-mine.css"/>
<!--<link rel="stylesheet" href="js/uploadify/uploadify.css"/>-->
<link type="text/css" rel="stylesheet" href="js/jOrgChart/css/jquery.jOrgChart.css" />
<link type="text/css" rel="stylesheet" href="js/ajaxloader/ajaxloader.css"/>
<link type="text/css" rel="stylesheet" href="css/file-upload.css"/>
<link type="text/css" rel="stylesheet" href="css/style.css"/>

<script type="text/javascript" src="js/sys-params-map.jsp"></script>
<script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.10.4.min.js"></script>
<!--<script type="text/javascript" src="js/datepicker-ar.js"></script>-->
<!--<script type="text/javascript" src="js/fileinput/jquery.fileinput.min.js"></script>-->
<script type="text/javascript" src="js/appendGrid/jquery.appendGrid-1.3.5.min.js"></script>
<script type="text/javascript" src="js/validation/jquery.validate.min.js"></script>
<script type="text/javascript" src="js/validation/additional-methods.js"></script>
<script type="text/javascript" src="js/validation/messages_en.js"></script>
<script type="text/javascript" src="js/validation/jquery.ui.datepicker.validation.min.js"></script>
<script type="text/javascript" src="js/jquery.tablesorter/jquery.tablesorter.min.js"></script>
<!--<script type="text/javascript" src="js/uploadify/jquery.uploadify.min.js"></script>-->
<script type="text/javascript" src="js/jOrgChart/jquery.jOrgChart.js"></script>
<script type="text/javascript" src="js/ajaxloader/ajaxloader.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript" src="js/app.js"></script>

<script type="text/javascript">
$(function(){

      $("body").prop("class","pure-skin-mine");
      $("form").prop("class","pure-form");
      
      // init calendar elements
      $(".caldr").datepicker( {dateFormat : 'dd/mm/yy', changeMonth: true, changeYear: true, yearRange:"2010:+3"});
    
      initFileInputElements();
      
      // add default option to dropdown lists
      $("select:not(.auto_off)").prepend("<option value=''>please select</option>").each(function(){if($(this).find("option[selected='selected']").size()== 0)  this.selectedIndex=0}); 
     
      // style buttons with pure framework
      $("input[type='button']").addClass("pure-button");
      $("input[type='submit']").addClass("pure-button pure-button-primary"); 
	   
      
      // add margin between horizontal radio group 
      $("input[type='radio']").css("margin-right","4px");
      $("input[type='radio']").next().css("margin-left","15px");
      
      // add margin between horizontal checkbox group 
      $("input[type='checkbox']").css("margin-right","4px");
      $("input[type='checkbox']").next().css("margin-left","15px");
    
	  $("form").attr('novalidate', 'novalidate');
	  $("form").validate({
		
				// ignore: ":hidden:not(input:file)", // to allow hidden
				// fields to validated
		
				errorPlacement : function(error, element) { // to adjust
					// the radio
					// and
					// checkbox
					// group msg
					// placement
					if ($(element).is("input:file")) {
						if (element.closest("label").parent().find(
								"span[class='requiredField']").length > 0)
							error
									.insertAfter(element
											.closest("label")
											.parent()
											.find(
													"span[class='requiredField']"));
						else
							error.insertAfter(element.closest("label"))
					} else {
							error.appendTo(element.parent());
					}
				}
			// debug:false,
			// focusInvalid: false,
			// onfocusout: false
			// onkeyup: false
			// rules:{
			// plannedStartDate: {
			// required:true,
			// dpDate:true,
			// dpCompareDate: ['before', '#plannedEndDate']
			// },
			// plannedEndDate:{
			// required:true,
			// dpDate:true,
			// dpCompareDate: ['after', '#plannedStartDate']
			// }
			//			  
			// }
		});
		
		initRequiredFields();
	  
});
</script>
<%}%>
</head>
<body>
<noscript>
<div id="page_mask"> You can not  use the application with the javascript disabled <br />
  please enable javascript from browser configurations<br />
  then click <a href='<%=request.getAttribute("javax.servlet.forward.request_uri")%>'>here</a> to continue </div>
</noscript>
<div id="page_container">
	
	<%@ include file="Menu.jsp" %>
	<div class="clearer"></div>
	<div id="page_body">
       <%=msg%>
	   <jsp:include page="<%=dest%>" flush="true" />
	</div>
	
</div>
</body>
</html>
